<html>

<head>
<script type="text/javascript" src="${createLinkTo(dir:'js')}/prototype.js"></script>
<script type="text/javascript" src="${createLinkTo(dir:'js')}/scriptaculous.js?load=effects,builder"></script>
</head>

<body>
<div id="shoppingCartContent">
<p>Welcome ${session.authenticatedUser.login},</p>

<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>
<br/>
<g:if test="${shoppingCartItemsList} != '' || ${shoppingCartItemsList} != null">
<g:each in="${shoppingCartItemsList}" status="i" var="items">
	<img src="${items.thumbnailPath}"/><br/>
	${items.name}, ${currencySign}${items.price}<br/>
	<span onclick="javascript:shoppingcartHelper.removeFromCart(${items.id});">
	<a title="Remove item from shopping cart" onmouseover="this.style.cursor='pointer';">Remove this</a>
	</span>
	<br/><br/>
</g:each>
Total price: ${currencySign}${session.totalPrice}
<br/>
</g:if>
<br/>
<!--
${session.userCart}
<br/>
Session ID = ${session.getId()}
<br/>
IP = ${request.getRemoteAddr()}
<br/>
-->
<div class="nav">
	<span class="menuButton">
		<a title="Update/Current Shopping Cart" href="javascript:shoppingcartHelper.viewCart();">
		<img src="/PictureCentral/images/shoppingcart/shoppingcart_update.png"/>
		</a>
		<g:remoteLink controller="shoppingCart" action="view" update="shoppingCartContent" title="View Shopping Cart">View Cart</g:remoteLink>
	</span>
	<g:if test="${session.userCart != '' && session.userCart != null}">
		<g:if test="${session.authenticatedUser.login != '' && session.authenticatedUser.login != null}">
			<span class="menuButton">
				<a title="Check Out" href="javascript:shoppingcartHelper.checkOutCart()">
				<img src="/PictureCentral/images/shoppingcart/shoppingcart_checkout.png"/>
				</a>
			</span>
		</g:if>
		<span class="menuButton">
			<a title="Clear Shopping Cart" href="javascript:shoppingcartHelper.clearCart();">
			<img src="/PictureCentral/images/shoppingcart/shoppingcart_delete2.png"/>
			</a>
		</span>
	</g:if>
</div>
</div>
</body>
</html>